package exam.service.impl;

import com.github.pagehelper.PageHelper;
import exam.bean.House;
import exam.bean.Teacher;
import exam.dao.HouseDao;
import exam.service.IHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
@Service
public class HouseServiceImpl implements IHouseService {
    @Autowired
    private HouseDao houseDao;
    @Override
    public List<House> selectHouse(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        return houseDao.selectHouse(null);
    }

    @Override
    public int insertHouse(House house) {
        return houseDao.insertHouse(house);
    }

    @Override
    public int updateHouse(House house) {
        return houseDao.updateHouse(house);
    }

    @Override
    public int deleteHouse(int id) {
        return houseDao.deleteHouse(id);
    }

    @Override
    public House selectHouseById(Map<String, Object> map) {
        return houseDao.selectHouse(map).get(0);
    }
}
